package cn.skillith.showcompanybackend.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/health")
public class HealthController {
    
    @GetMapping("/check")
    public Map<String, Object> healthCheck() {
        Map<String, Object> response = new HashMap<>();
        response.put("status", "UP");
        response.put("timestamp", java.time.LocalDateTime.now());
        response.put("message", "后端服务正常运行");
        return response;
    }
    
    @GetMapping("/admin")
    public String adminTest() {
        return "<html><body><h1>管理员测试页面</h1><p>如果您能看到这个页面，说明后端服务正常运行</p><p>时间: " + java.time.LocalDateTime.now() + "</p></body></html>";
    }
}
